const Sequelize = require('sequelize')
const sequelize = require('../mysql')
const Project = require('./projectModel')
class Page extends Sequelize.Model {}
Page.init({
  id: {
    type: Sequelize.INTEGER(11).UNSIGNED,
    autoIncrement: true,
    unique: true,
    primaryKey: true
  },
  projectId: {
    type: Sequelize.INTEGER(11).UNSIGNED,
    allowNull: false
  },
  name: Sequelize.STRING(255)
}, { sequelize, modelName: 'page' })
Page.belongsTo(Project, { foreignKey: 'projectId', targetKey: 'id' })
// 添加 fk_companyname 到 User
module.exports = Page
